<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="单据类型配置" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData()"
                            ng-disabled="!btnPermission.billTypeAdd" translate translate-attr-title="{{!btnPermission.billTypeAdd?'无权限执行此操作':''}}">新增</button>
                    <button class="btn btn-operate" ng-click="delData('batch')"
                            ng-disabled="!btnPermission.billTypeDel" translate translate-attr-title="{{!btnPermission.billTypeDel?'无权限执行此操作':''}}">删除</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tbConf" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tbConf.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll(dataList)"></div>
                                </th>
                                <th ng-repeat="itemCol in tbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tbConf.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tbConf.fixedWidth" fixed-width="tbStyle.scrollLeft"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-click="toSort(tbConf.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tbConf.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index"
                                ng-class="{'row-selected': $index === markInfo.cueRow}" ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item, dataList)"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">
                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="!btnPermission.billTypeEdit" translate translate-attr-title="{{!btnPermission.billTypeEdit?'无权限执行此操作':''}}">编辑</button>
                                        <button class="btn btn-operate" ng-click="delData('single', item.id)"
                                                ng-disabled="!btnPermission.billTypeDel" translate translate-attr-title="{{!btnPermission.billTypeDel?'无权限执行此操作':''}}">删除 </button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index"
                                ng-class="{'row-selected': $index === markInfo.cueRow}" ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tbConf.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                    <div class="font-0" ng-if="itemCol.type === 'operate'">
                                        <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="!btnPermission.billTypeEdit" title="{{!btnPermission.billTypeEdit?'无权限执行此操作':''}}">编辑</button>
                                        <button class="btn btn-operate" ng-click="delData('single', item.id)"
                                                ng-disabled="!btnPermission.billTypeDel" title="{{!btnPermission.billTypeDel?'无权限执行此操作':''}}">删除 </button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allChecked" yb-check-name="全选"
                     yb-click="selectAll(dataList)"></div>
                <button class="btn btn-operate" ng-click="delData('batch')"
                        ng-disabled="!btnPermission.billTypeDel" translate translate-attr-title="{{!btnPermission.billTypeDel?'无权限执行此操作':''}}">删除</button>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>单据类型</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="type" class="form-control" ng-model="detailInfo.type"
                                   required yb-focus maxlength="30">
                        </div>
                        <div class="col-xs-4 msg-block"
                             ng-show="form.type.$dirty || (form.type.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.type.$error.required && !form.type.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group m-b-xs">
                        <label class="col-xs-2 control-label"><span translate>出/入库</span>：</label>
                        <label class="col-xs-5 control-label p-l-n text-left">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.inOut"
                                   value="0" yb-radio-name="入库类型">
                            <input type="radio" class="m-r-md pull-left" yb-radio ng-model="detailInfo.inOut"
                                   value="1" yb-radio-name="出库类型">
                        </label>
                    </div>
                    <div class="form-group save-bar m-b-none">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)" translate>
                                保存
                            </button>
                            <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>